package org.wangle.goods.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.wangle.api.goods.pojo.Goods;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wangle
 * @since 2021-07-21
 */

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {

    @Update("update goods set stock = stock - 1")
    void decrementStock(Integer goodsId);

    @Update("update goods set stock = stock + 1")
    void incrementStock(Integer goodsId);

}
